package com.stx.design.Iterator;

import java.util.ArrayList;
import java.util.List;

public  class ConcreteAggregate<T> implements Aggregate<T>{

	 private List<T> lists = new ArrayList<>();
	 
	@Override
	public void add(T t) {
		lists.add(t);
	}

	@Override
	public void remove(T t) {
		lists.remove(t);
	}

	@Override
	public Iterator<T> createIterator() {
		 return  new ConcreteIterator(lists);
	}

}
